package com.example.mapper;

import com.example.entity.ClubComment;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClubCommentMapper {
    @Select("SELECT c.*, s.name as studentName FROM club_comment c " +
            "LEFT JOIN student s ON c.student_id = s.id " +
            "WHERE c.club_id = #{clubId} ORDER BY c.create_time DESC")
    List<ClubComment> selectByClubId(Integer clubId);

    @Insert("INSERT INTO club_comment (club_id, student_id, content, images) VALUES (#{clubId}, #{studentId}, #{content}, #{images})")
    int insert(ClubComment comment);
} 